package fy.test;

import java.util.List;

import fy.config.FyConfig;
import fy.form.listen.manager.MyImport;
import fy.form.listen.operate.IFormOperator;
import fy.form.listen.set.OA_UAPAccountContrast;

public class Write {
	public static void main(String[] args) {
		FyConfig.setUAP_DB_CONFIG("nc", "nc2012",
				"jdbc:oracle:thin:@10.111.0.32:1521:u111", "uapdb",
				"oracle.jdbc.driver.OracleDriver");

		FyConfig.setERP_DB_CONFIG("appsro", "appsro2012",
				"jdbc:oracle:thin:@192.168.254.28:1521:prod", "from_erp",
				"oracle.jdbc.driver.OracleDriver");
		OA_UAPAccountContrast.initAccountContrast();
		List<Long> summaryList = MyImport.getSummaryArray();
		for (int i = 0, size = summaryList.size(); i < size; i++) {
			try {

				IFormOperator fo = new fy.test.Rest_MergerProviderFormOperator();
				if (fo != null) {
					boolean success = false;
					System.out
							.println("*****************************************************************");
					try {
						fo.operate(summaryList.get(i), 0L);
						success = fo.isSuccess();
					} catch (Exception e) {
						e.printStackTrace();
					}

					if (!success) {
						System.out.println("写入失败" + summaryList.get(i));
						// log.error("发生异常：并写入日志，路径：" + logFilePath);
					}
					fo = null;
				}
			} catch (Exception e1) {
				e1.printStackTrace();
			}
		}

	}
}